const request = require("request");
function getMemberList(cookie) {
  return new Promise((resolve) => {
    request(
      {
        url: "https://www.bigfun.cn/api/feweb?target=kan-gong-guild-log-filter%2Fa",
        method: "get",
        headers: {
          Cookie: cookie,
        },
      },
      (err, res, body) => {
        resolve(JSON.parse(body).data.member);
      }
    );
  });
}

function getHzList(cookie) {
  return new Promise((resolve) => {
    request(
      {
        url: "https://www.bigfun.cn/api/feweb?target=kan-gong-guild-report%2Fa&date=",
        method: "get",
        headers: {
          Cookie: cookie,
        },
      },
      (err, res, body) => {
        resolve(JSON.parse(body).data);
      }
    );
  });
}

module.exports = {
  getMemberList,
  getHzList,
};
